package jk.fox.spring.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * @author cuichao
 * @Description: FoxRpcConfigurationProperties
 * @Date: create in 2020/6/1 21:56
 */
@Getter
@Setter
@ConfigurationProperties(prefix = FoxRpcConfigurationProperties.prefix)
public class FoxRpcConfigurationProperties {

    public static final String prefix = "fox.rpc";
    /**
     * 是否启动Rpc服务
     */
    private boolean enable = true;
    /**
     * Rpc端口号
     */
    private int port = 9871;

    /**
     * 连接最大重试次数
     */
    private int connectMaxRetries = 3;
    /**
     *  连接最大重试间隔
     */
    private long connectRetryIntervalMs = 10000L;
    /**
     * 是否启用同源调用
     */
    private boolean enableSameSource = true;
    /**
     * 请求超时时间
     */
    private long requestTimeOutMs = 30000;
    /**
     * 是否允许request超时重试
     */
    private boolean enableRequestRetry = false;
    /**
     * 请求最大重试次数
     */
    private int requestMaxRetires = 3;

    @NestedConfigurationProperty
    private RegistryConfigurationProperties registry;

    @NestedConfigurationProperty
    private TransportConfigurationProperties transport;


}
